package com.woniuxy.common.mapper;

import com.woniuxy.common.entity.ForumMessage;
import com.woniuxy.common.entity.ForumMessageExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ForumMessageMapper {
    long countByExample(ForumMessageExample example);

    int deleteByExample(ForumMessageExample example);

    int deleteByPrimaryKey(String id);

    int insert(ForumMessage record);

    int insertSelective(ForumMessage record);

    List<ForumMessage> selectByExampleWithBLOBs(ForumMessageExample example);

    List<ForumMessage> selectByExample(ForumMessageExample example);

    ForumMessage selectByPrimaryKey(String id);

    int updateByExampleSelective(@Param("record") ForumMessage record, @Param("example") ForumMessageExample example);

    int updateByExampleWithBLOBs(@Param("record") ForumMessage record, @Param("example") ForumMessageExample example);

    int updateByExample(@Param("record") ForumMessage record, @Param("example") ForumMessageExample example);

    int updateByPrimaryKeySelective(ForumMessage record);

    int updateByPrimaryKeyWithBLOBs(ForumMessage record);

    int updateByPrimaryKey(ForumMessage record);
    //查找历史记录
    List<ForumMessage> findRecord(@Param("userId") String userId,@Param("oppositeUserId") String oppositeUserId);
    //标记已读
    @Update("update forum_message set status=1 where id=#{id}")
    void isRead(String id);
}